
class MarketData:

    def __init__(self, marketdata):
        instrument = marketdata.getElementsByTagName("instrument")[0]
        self.price = float(instrument.getAttribute("price"))
        self.volatility = float(instrument.getAttribute("volatility"))
        self.rate = float(instrument.getAttribute("rate"))

    def __repr__(self):
        return "<MarketData rate:%s price:%s volatility:%s>" % (self.rate, self.price, self.volatility)
